from sqlalchemy import Column, ForeignKey, Sequence
from sqlalchemy.types import Integer, String
from sqlalchemy.orm import relationship
from __init__ import Base

class Comments(Base):

    __tablename__ = "comments"

    id = Column(Integer, Sequence('comment_id_seq'), primary_key=True)
    comment = Column(String(200))
    owner = Column(Integer, ForeignKey('users.id'))

    commentoperation = relationship('CommentOperation')
    commentgrid = relationship('CommentGrid')

    def __init__(self, comment, owner):
        self.comment = comment
        self.owner = owner

    def __repr__(self):
        return "<Comments('%s', '%s')>" % (self.comment, self.owner)
